<% note = local_assigns.fetch(:note, @note) -%>
<% show_no_diff_preview_message = false -%>
<% unless @note.nil? -%>
<%   discussion = local_assigns.fetch(:discussion) { note.discussion } if note.part_of_discussion? -%>
<%   project = local_assigns.fetch(:project, @project) -%>
<%   show_no_diff_preview_message = discussion&.diff_discussion? && discussion.on_text? && !project.show_diff_preview_in_email? -%>
<% end -%>
<%= text_header_message %>

<%= yield -%>

-- <%# signature marker %>
<%  if show_no_diff_preview_message -%>
<%=   "This project does not include diff previews in email notifications.\n" -%>
<%  end -%>
<%  if @target_url -%>
<%    if @reply_by_email -%>
<%=     "Reply to this email directly or view it on GitLab: #{@target_url}" -%>
<%    else -%>
<%=     "View it on GitLab: #{@target_url}" -%>
<%    end -%>
<%  end -%>

<%= notification_reason_text(reason: @reason) %>
<%= render_if_exists 'layouts/mailer/additional_text' %>

<%= text_footer_message -%>
